package com.atguigu.crowd.funding.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.atguigu.crowd.funding.entity.Auth;
import com.atguigu.crowd.funding.entity.AuthExample;
import com.atguigu.crowd.funding.mapper.AuthMapper;
import com.atguigu.crowd.funding.service.api.AuthService;

@Service
public class AuthServiceImpl implements AuthService {

	@Autowired
	private AuthMapper authMapper;
	
	public List<Auth> getAllAuth(){
		
		List<Auth> auths=authMapper.selectByExample(new AuthExample());
		return auths;
	}

	@Override
	public List<Auth> getAuthByRole(Integer roleid) {
		// TODO Auto-generated method stub
		return authMapper.selectAuthByRole(roleid);
	}

	@Override
	public void updateRoleAuth(Integer roleid, List<Integer> authids) {
		// TODO Auto-generated method stub
		authMapper.deleteRoleAuth(roleid);
		authMapper.saveRoleAuth(roleid,authids);
	}
	
}
